import xadmin

from .models import UserFavorite,UserComments,UserRecommend,UserBrowse


class UserFavoriteAdmin(object):
    """用户收藏后台"""
    list_display=['user','movie_id','add_time']
    search_fields=['user','movie_id']
    list_filter=['user','movie_id','add_time']


class UserCommentsAdmin(object):
    """用户评论后台"""
    list_display = ['user','movie','comment','add_time']
    search_fields = ['user','movie','comment']
    list_filter = ['user','movie','comment','add_time']


class UserRecommendAdmin(object):
    """个人推荐"""
    list_display = ['user', 'movie_id', 'add_time']
    search_fields = ['user','movie_id']
    list_filter = ['user','movie_id','add_time']


class UserBrowseAdmin(object):
    """历史浏览"""
    list_display = ['user','movie_id','add_time']
    search_fields = ['user','movie_id']
    list_filter = ['user','movie_id','add_time']


class UserRatingsAdmin(object):
    """用户评分"""
    list_display = ['user', 'movie', 'ratings','add_time']
    search_fields = ['user', 'movie', 'ratings']
    list_filter = ['user', 'movie', 'ratings','add_time']

xadmin.site.register(UserFavorite, UserFavoriteAdmin)
xadmin.site.register(UserComments,UserCommentsAdmin)
xadmin.site.register(UserRecommend,UserRecommendAdmin)
xadmin.site.register(UserBrowse,UserBrowseAdmin)